﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IFTRUE.FMS.Web.Aspx
{
    public partial class FileRecycle : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblMsg.Text = "当前路径：" + ((FileManager1.RootDirectories[0].DirectoryPath.IndexOf("~") == 0) ? Server.MapPath(FileManager1.RootDirectories[0].DirectoryPath) : FileManager1.RootDirectories[0].DirectoryPath);
            }
        }

        protected void FileManager1_FileDownload(object sender, IZ.WebFileManager.DownloadFileCancelEventArgs e)
        {
            new BLL.Log().Add(2, "回收站管理", string.Format("用户（{0}）下载文件（{1}）", MySession.CurrentUser.Account,e.DownloadFile.FileManagerPath));
        }

        protected void FileManager1_FileDeleting(object sender, IZ.WebFileManager.DeleteItemsActionEventArgs e)
        {
            if (e.SelectedItems != null && e.SelectedItems.Count > 0)
            {
                BLL.Log logBLL=new BLL.Log();
                for (int i = 0; i < e.SelectedItems.Count; i++)
                {
                    logBLL.Add(2, "回收站管理", string.Format("用户（{0}）删除文件（{1}）", MySession.CurrentUser.Account, e.SelectedItems[i].FullName));
                }
            }
        }
    }
}